package ys.ewp.junit;

import java.util.Date;
import java.util.List;

import org.junit.Test;

import ys.ewp.po.Department;
import ys.ewp.po.Employee;

public class EmployeeTest extends BaseJunit {
	
	@Test
	public void saveEmp(){
		Department dep = new Department();
		dep.setDateCreated(new Date());
		dep.setName("技术部");
		dep.setDescription("技术开发");
		
		Employee emp = new Employee();
		emp.setRealName("黄健");
		emp.setDepartment(dep);
		
		departmentService.save(dep);
		employeeService.save(emp);
	}
	
	@Test
	public void getEmpListByDepId(){
		List<Employee> employeeList = employeeService.getEmployeeListByDepId(1);
		System.out.println(employeeList.get(0));
	}
	
	@Test
	public void deleteEmploee(){
		Employee emp = employeeService.get(2);
		employeeService.delete(emp);
	}
	
}
